package com.yami.shop.common.config;


import com.yami.shop.common.util.MinIOUtils;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: interface
 * @description: 文件上传配置
 * @author: hdh
 * @create: 2023:03:07 09:46
 */
@Configuration
@Data

public class MinIOConfig {
    @Value("http://47.97.125.11:9000")
    private String endpoint;
    @Value("http://47.97.125.11:9000")
    private String fileHost;
    @Value("bsoft")
    private String bucketName;
    @Value("minioadmin")
    private String accessKey;
    @Value("minioadmin")
    private String secretKey;

    @Value("1024")
    private Integer imgSize;
    @Value("1024")
    private Integer fileSize;

    @Bean
    public MinIOUtils creatMinioClient() {
        return new MinIOUtils(endpoint, bucketName, accessKey, secretKey, imgSize, fileSize);
    }
}
